package top.lingkang.potato.views;

import cn.hutool.core.lang.Assert;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.controlsfx.control.Notifications;

import java.io.IOException;
import java.net.URL;

/**
 * 主页面
 */
public class HomeView extends Stage {
    public HomeView() {
        super();
        URL resource = getClass().getResource("/fxml/home.fxml");
        Assert.isFalse(resource == null, "加载fxml失败！");
        VBox root = null;
        try {
            root = FXMLLoader.load(resource);
        } catch (IOException e) {
            e.printStackTrace();
            Assert.isNull(e, e.getMessage());
        }

        setScene(new Scene(root));
        getIcons().add(new Image("assets/img/potato.png"));
        show();
        Notifications notifications = Notifications.create();
        notifications.title("通知");
        notifications.text("您上次登录ip:47.107.40.136。\n位于中国深圳市");
        notifications.show();
    }




}